package com.learning.crpc.provider.socket;

import com.alibaba.fastjson.JSONObject;
import com.learning.crpc.model.CrpcRequest;

/**
 * @program: diy_rpc
 * @description:
 * @author: CaoYong
 * @create: 2021-07-01 14:26
 **/
public class ProtocolMock {

    final static byte[] MAGIC = new byte[] {(byte) 0xda, (byte) 0xbb};

    public static void main(String[] args) {
        CrpcRequest crpcRequest = new CrpcRequest();
        crpcRequest.setClassName("com.demo.sms.service.SmsService");
        crpcRequest.setMethodName("sendMessage");
        Class[] parameterTypes = new Class[] {String.class, String.class};
        Object[] arguments = new Object[] {"111111111", "hello"};
        crpcRequest.setParameterTypes(parameterTypes);
        crpcRequest.setArguments(arguments);

        String crpcRequestStr = JSONObject.toJSONString(crpcRequest);
    }
}
